#include "myconfig.h"

QSettings* MyConfig::settings;
QString MyConfig::network_hostname_;
int MyConfig::network_port_;
int MyConfig::video_frame_per_second_;
int MyConfig::video_pix_quality_;
QString MyConfig::video_pix_type_;


void MyConfig::init()
{
    //config.ini
    settings=new QSettings(":/config/client.ini", QSettings::IniFormat);
    //
    network_hostname_=settings->value("network/host").toString();
    network_port_=settings->value("network/port").toInt();
    video_frame_per_second_=settings->value("video/frame.per.second").toInt();
    video_pix_quality_=settings->value("video/pix.quality").toInt();
    video_pix_type_=settings->value("video/pix.type").toString();
}

QString MyConfig::getValue(const QString &key)
{
    return settings->value(key).toString();
}

void MyConfig::setValue(const QString &key, const QString &value)
{
    settings->setValue(key, value);
}
